package com.tatesuke.automine.solver;

import java.awt.Point;

/**
 * x, ｙでなく行・列で表す座標
 *
 * 　　列→
 * 　　０１２３４・・・
 * 行０□□□□□□□□
 * ↓１□□□□□□□□
 * 　２□□□□□□□□
 * 　３□□□□□□□□
 * 　：□□□□□□□□
 * 　：□□□□□□□□
 * @author tatesuke
 */
public class Coordinate {

	private Point point;

	public Coordinate(int row, int column) {
		point = new Point(column, row);
	}

	public int getRow() {
		return point.y;
	}


	public int getColumn() {
		return point.x;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Coordinate)) {
			return false;
		}

		return point.equals(((Coordinate) obj).point);
	}

	@Override
	public int hashCode() {
		return point.hashCode();
	}

	@Override
	public String toString() {
		return "[" + point.y + ", " + point.x + "]";
	}

}
